<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML>
<html>
  <head>
    <title>登录</title>
    <script type="text/javascript" src="resources/js/jquery.min.js"></script>
	<script type="text/javascript" src="resources/js/operamasks-ui.min.js"></script>
	<link rel="stylesheet" type="text/css" href="resources/css/apusic/om-apusic.css" />
	<link rel="stylesheet" type="text/css" href="resources/css/apusic/login-validate.css" />
<!--<link rel="stylesheet" type="text/css" href="resources/css/default/om-default.css" />-->
	<style>
    	html, body{ width: 100%; height: 100%; padding: 0; margin: 0;}
    		#center-tab .om-panel-body{
    		padding: 0;
    	}
    	#loginform label {color:red;}
    </style>
    <script language="JavaScript"> 
 		if (window != top) 
 			top.location.href = location.href; 
 	</script>
	<script type="text/javascript" >
  	$(document).ready(function() {
   		var dialog = $("#dialog-form").omDialog({
   			title:'OperaMaskUi开放开发平台 v0.1',
            width: 350,
            autoOpen : true,
            modal : true,
            resizable : false,
			buttons:[{
				text:'提交',
				click:function(){
					$("#loginform").omAjaxSubmit({
       			 		beforeSubmit:function(){
       				 		$('#errorMessages').html('登录中。。。').show();
               		},
						success:function(responseText,statusText, xhr, $form){
               				$('#errorMessages').hide();
								if(responseText=='true'){
           				 			$("#dialog-form").omDialog("close"); //关闭dialog
           				 			self.location.href='system/main.jsp';
								}else{
							 		$('#errorMessages').html('用户名或密码错误！').show();
								}
       					}
           			})
				}
			},{
				text:'重置',
				click:function(){
					$('#username').val('');
            		$('#password').val('');
            		$('#errorMessages').hide();
				}
			}]
        });
        //获得焦点隐藏提示信息
   		$("#username").focus(function(){
   			$('#errorMessages').hide();
   	   	});
   		$("#password").focus(function(){
   			$('#errorMessages').hide();
   	   	});
        
	});
	</script>
	</head>
  <body >
   		<div id="dialog-form">
   			<form  id="loginform" action="sysLogin/login.action">
   				<table>
   					<tr>
						<td width="75" align="right">用户名:</td>
						<td width="245"><input type="text" onfocus=this.select() id="username" name="userName"/></td>
					</tr>
   					<tr>
						<td width="75" align="right">密　码:</td>
						<td><input type="password" id="password" onfocus=this.select() name="password"/></td>
					</tr>
					<tr>
   						<td colspan="2">
   							<div  align="center" id="errorMessages"></div>
   						</td>
   					</tr>
   					
   				</table>
   			</form>
   		</div>
   		
  </body>
</html>
